import { createSlice, createAsyncThunk } from '@reduxjs/toolkit';

const commoditySlice = createSlice({
    name: "commodity",
    initialState: {
        alterState: false,
        commodityData: {
            images: [],
            types:{sort:""}
        }
    },
    reducers: {
        setCommodityData(state, action) {
            state.commodityData = action.payload;
        },
        setAlterState(state, action) { 
            state.alterState = action.payload;
            }
    },
    
});

export const { setCommodityData,setAlterState } = commoditySlice.actions;
export default commoditySlice.reducer;